<?php


	if (isloggedin()) {
		if ($_SESSION['user']->getGUID() != $vars['entity']->getGUID()) {
			
			if(check_entity_relationship($_SESSION['user']->getGUID(), "follower", $vars['entity']->guid)) {
					
					$url = $vars['url'].elgg_add_action_tokens_to_url("action/unfollow?object_guid=".$vars['entity']->guid);	
							
					echo "<p class='user_menu_unfollow'>";
					echo "<a href='$url'>".elgg_echo("unfollow:user")."</a>";	
					echo "</p>";	
			} else {	
					$url = $vars['url'].elgg_add_action_tokens_to_url("action/follow?object_guid=".$vars['entity']->guid);	
					
					echo "<p class='user_menu_follow'>";
					echo "<a href='$url'>".elgg_echo("follow:user")."</a>";	
					echo "</p>";						
			}
			
		}
		
	}

	?>